package com.hgyc.mom.base.entity;

import java.math.BigDecimal;
import java.io.Serializable;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.*;

import com.hgyc.mom.common.annotation.Excel;
import com.hgyc.mom.core.annotation.DictColumn;
import com.hgyc.mom.core.annotation.TableDict;
import com.hgyc.mom.core.mybatis.EQ;
import com.hgyc.mom.core.mybatis.Like;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

/**
 * <p>
 * 物料基础信息
 * </p>
 *
 * @author fwj
 * @since 2025-04-28
 */
@Data
@TableName("base_material")
@Schema(name="物料基础信息对象", description="物料基础信息对象")
public class Material implements Serializable
{
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @Schema(name = "$column.columnComment")
    private Long id;

    @Excel(name = "物料编码")
    @Like
    @Schema(name = "物料编码")
    private String materialCode;

    @Excel(name = "物料名称")
    @Like
    @Schema(name = "物料名称")
    private String materialName;

    @Excel(name = "型号规格")
    @Schema(name = "型号规格")
    private String spec;

    @Excel(name = "系列ID")
    @Schema(name = "系列ID")
    @TableDict(table="base_product_series", key = "id", columns = {
            @DictColumn(name = "name", alias = "seriesName")
    })
    private Long seriesId;

    @Excel(name = "单位ID")
    @Schema(name = "单位ID")
    @TableDict(table="base_unit", key = "id", columns = {
            @DictColumn(name = "unit_name", alias = "unitName")
    })
    private Long unitId;

    @Excel(name = "类型ID")
    @Schema(name = "类型ID")
    @TableDict(table="base_material_type", key = "id", columns = {
            @DictColumn(name = "type_name", alias = "typeName")
    })
    @EQ
    private Long typeId;

    @Excel(name = "状态")
    @EQ
    @Schema(name = "状态，1有效0无效")
    private Integer status;

    @Excel(name = "是否免检")
    @Schema(name = "是否免检，1是0否")
    private String inspectExempted;

    @Excel(name = "是否设置安全库存")
    @Schema(name = "是否设置安全库存")
    private Integer safeStockFlag;

    @Excel(name = "最低库存量")
    @Schema(name = "最低库存量")
    private BigDecimal minStock;

    @Excel(name = "最大库存量")
    @Schema(name = "最大库存量")
    private BigDecimal maxStock;

    @Excel(name = "描述")
    @Schema(name = "描述")
    private String description;

    @TableField(fill = FieldFill.INSERT)
    @Schema(name = "$column.columnComment")
    private Long createBy;

    @TableField(fill = FieldFill.INSERT)
    @Schema(name = "$column.columnComment")
    private LocalDateTime createTime;

    @TableField(fill = FieldFill.UPDATE)
    @Schema(name = "$column.columnComment")
    private Long updateBy;

    @TableField(fill = FieldFill.UPDATE)
    @Schema(name = "$column.columnComment")
    private LocalDateTime updateTime;

}
